def aaa(l):
    assert len(l) == 1, 'len not 1'
    print 'assert finished'

aaa([1,])

try:
    aaa([1,2])
except AssertionError, e:
    print e
